package com.zkthink.ceres.store.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.zkthink.base.entity.Entity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
import static com.zkthink.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;

/**
 * <p>
 * 实体类
 * 店铺提现历史
 * </p>
 *
 * @author chenke
 * @since 2022-04-29
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ceres_store_withdraw_his")
@ApiModel(value = "StoreWithdrawHis", description = "店铺提现历史")
@AllArgsConstructor
public class StoreWithdrawHis extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 会员id
     */
    @ApiModelProperty(value = "会员id")
    @TableField("mid")
    @Excel(name = "会员id")
    private Long mid;

    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺id")
    @TableField("store_id")
    @Excel(name = "店铺id")
    private Long storeId;

    /**
     * 小红心的数目
     */
    @ApiModelProperty(value = "小红心的数目")
    @TableField("red_heart")
    @Excel(name = "小红心的数目")
    private BigDecimal redHeart;

    /**
     * 提现的金额
     */
    @ApiModelProperty(value = "提现的金额")
    @TableField("cash")
    @Excel(name = "提现的金额")
    private BigDecimal cash;

    /**
     * 提现的手续费
     */
    @ApiModelProperty(value = "提现的手续费")
    @TableField("rate")
    @Excel(name = "提现的手续费")
    private BigDecimal rate;

    /**
     * 提现类型:0现金提现1:小红心提现
     */
    @ApiModelProperty(value = "提现类型:0现金提现1:小红心提现")
    @TableField("withdraw_type")
    @Excel(name = "提现类型:0现金提现1:小红心提现")
    private Integer withdrawType;

    /**
     * 提现账户
     */
    @ApiModelProperty(value = "提现账户")
    @Length(max = 65535, message = "提现账户长度不能超过65535")
    @TableField("withdraw_account")
    @Excel(name = "提现账户")
    private String withdrawAccount;
    /**
     * 真实姓名
     */
    @ApiModelProperty(value = "真实姓名")
    @TableField("name")
    private String name;
    /**
     * 账户类型0:微信1:支付宝
     */
    @ApiModelProperty(value = "账户类型0:微信1:支付宝")
    @TableField("account_type")
    @Excel(name = "账户类型0:微信1:支付宝")
    private Integer accountType;

    /**
     * 申请提现时间
     */
    @ApiModelProperty(value = "申请提现时间")
    @TableField("withdraw_time")
    @Excel(name = "申请提现时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime withdrawTime;

    /**
     * 审核状态0:审核中1:审核通过2:不通过
     */
    @ApiModelProperty(value = "审核状态0:审核中1:审核通过2:不通过")
    @TableField("supply_status")
    @Excel(name = "审核状态0:审核中1:审核通过2:不通过")
    private Integer supplyStatus;

    /**
     * 审核人id
     */
    @ApiModelProperty(value = "审核人id")
    @TableField("adjust_id")
    @Excel(name = "审核人id")
    private Long adjustId;

    /**
     * 审核时间
     */
    @ApiModelProperty(value = "审核时间")
    @TableField("adjust_time")
    @Excel(name = "审核时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime adjustTime;

    /**
     * 提现订单id
     */
    @ApiModelProperty(value = "提现订单id")
    @Length(max = 255, message = "提现订单id长度不能超过255")
    @TableField(value = "withdraw_id", condition = LIKE)
    @Excel(name = "提现订单id")
    private String withdrawId;

    @ApiModelProperty(value = "")
    @Length(max = 65535, message = "长度不能超过65535")
    @TableField("remark")
    @Excel(name = "")
    private String remark;


    @Builder
    public StoreWithdrawHis(Long id, LocalDateTime updateTime, Long createUser, LocalDateTime createTime, Long updateUser,
                    Long mid, Long storeId, BigDecimal redHeart, BigDecimal cash, BigDecimal rate, 
                    Integer withdrawType, String withdrawAccount, Integer accountType, LocalDateTime withdrawTime, Integer supplyStatus, Long adjustId, 
                    LocalDateTime adjustTime, String withdrawId, String remark,String name) {
        this.id = id;
        this.updateTime = updateTime;
        this.createUser = createUser;
        this.createTime = createTime;
        this.updateUser = updateUser;
        this.mid = mid;
        this.storeId = storeId;
        this.redHeart = redHeart;
        this.cash = cash;
        this.rate = rate;
        this.withdrawType = withdrawType;
        this.withdrawAccount = withdrawAccount;
        this.accountType = accountType;
        this.withdrawTime = withdrawTime;
        this.supplyStatus = supplyStatus;
        this.adjustId = adjustId;
        this.adjustTime = adjustTime;
        this.withdrawId = withdrawId;
        this.remark = remark;
        this.name = name;
    }

}
